package io2;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String line = "和我在成都的街头走一走，噢噢噢噢~~直到所有的灯都熄灭了，也不会停留...";
        bos.write(line.getBytes(StandardCharsets.UTF_8));
        bos.flush();
        System.out.println("写入完毕");
        bos.close();
    }
}
